<!DOCTYPE html>
<html>
<head>
    <title>车辆基本信息</title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("car:carbase:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("car:carbase:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("car:carbase:delete")>
                <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
			<#if shiro.hasPermission("car:carbase:editSellPrice")>
                <a class="btn btn-primary" @click="editSellPrice"><i class="fa fa-pencil-square-o"></i>&nbsp;售出</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <!--<div class="form-group">-->
                <!--<div class="col-sm-2 control-label">全部图片</div>-->
                <!--<div class="col-sm-10">-->
                    <!--&lt;!&ndash;<input type="text" class="form-control" v-model="carBase.imgs" placeholder="全部图片"/>&ndash;&gt;-->
                    <!--<input id="input-1a" type="file" class="file" language="zh" data-allowed-file-extensions='["jpg","png"]'>-->
                <!--</div>-->
            <!--</div>-->
            <div class="form-group">
                <div class="col-sm-2 control-label">车辆名称</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="carBase.searchName" placeholder="车辆名称(tip：哈弗H6)"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">年款</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="carBase.carYear" placeholder="年款（tip：2021款）"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">排量</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="carBase.carDisplacement" placeholder="排量（tip：1.5L）"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">上牌时间</div>
                <div class="col-sm-10">
                    <div class='input-group date' id='datetimepicker1'>
                        <input type='text' class="form-control" v-model="carBase.licenseTime" placeholder="上牌时间"/>
                        <span class="input-group-addon">
                            <span class="glyphicon glyphicon-calendar"></span>
                        </span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">行驶里程（KM）</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="carBase.driveMileage" placeholder="行驶里程"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">变速箱</div>
                <div class="col-sm-10">
                    <select class="form-control" v-model="carBase.transmission" placeholder="变速箱">
                        <option value="手动">手动</option>
                        <option value="自动">自动</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">颜色</div>
                <div class="col-sm-10">
                    <select class="form-control" v-model="carBase.colour" placeholder="颜色">
                        <option v-for="(item,index) in carColorList" :value="item.id">{{item.value}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">排放标准</div>
                <div class="col-sm-10">
                    <select class="form-control" v-model="carBase.emissionStandard" placeholder="排放标准">
                        <option v-for="(item,index) in pfbzList" :value="item.id">{{item.value}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">车型</div>
                <div class="col-sm-10">
                    <select class="form-control" v-model="carBase.model" placeholder="车型">
                        <option v-for="(item,index) in cxList" :value="item.id">{{item.value}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">倒手次数</div>
                <div class="col-sm-10">
                    <select class="form-control" v-model="carBase.sellNum" placeholder="倒手次数">
                        <option v-for="item in 10" :value="(item-1)">{{(item-1)}}次</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">所属商家</div>
                <div class="col-sm-10">
                    <select class="form-control" v-model="carBase.shopId" placeholder="所属商家">
                        <option v-for="(item,index) in shopList" :value="item.id">{{item.shopName}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">入手价格（元）</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="carBase.buyPrice" placeholder="入手价格"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">分钱相关店铺</div>
                <div class="col-sm-10">
                    <label class="checkbox-inline" v-for="item in carFriendShopList">
                        <input type="checkbox" v-model="carBase.friendShopId" :value="item.id"> {{item.friendShopName}}
                    </label>
                </div>
            </div>
            <!--<div class="form-group">-->
                <!--<div class="col-sm-2 control-label">备注</div>-->
                <!--<div class="col-sm-10">-->
                    <!--<input type="text" class="form-control" v-model="carBase.remark" placeholder="备注"/>-->
                <!--</div>-->
            <!--</div>-->
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" id="btnSaveOrUpdate" data-loading-text="保存中..." @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
    <div style="display: none" id="sellPriceDiv">
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">车辆状态</div>
                <div class="col-sm-10">
                    <select class="form-control" v-model="carBase.state">
                        <option value="10">售卖中</option>
                        <!--<option value="15">定金中</option>-->
                        <option value="20">已卖出</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">卖出价格（元）</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="卖出价格" v-model="carBase.sellPrice"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">买入价格（元）</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="买入价格（元）" v-model="carBase.buyPrice" readonly/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">杂七杂八开销</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="杂七杂八开销" v-model="carBase.otherPrice"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">杂七杂八说明</div>
                <div class="col-sm-10">
                    <!--<textarea rows="3" class="form-control" v-model="carBase.sellRemark"/>-->
                    <textarea class="form-control" rows="3" v-model="carBase.sellRemark"></textarea>
                </div>
            </div>
            <div class="form-group" v-if="carBase.carShopMoneyEntities" v-for="item in carBase.carShopMoneyEntities">
                <div class="col-sm-2 control-label">{{item.friendShopName}}分走</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="item.getMoney"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">利润（元）</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" placeholder="0.0" v-model="lastMoney"/>
                </div>
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/car/carbase.js?_${.now?long}"></script>
</body>
</html>